package com.ruoyi.system.controller;


import com.ruoyi.common.security.annotation.RequiresPermissions;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.concurrent.CountDownLatch;

@RestController
public class Test {
//    @Autowired
//
//
//    @Autowired
//
//    @RequestMapping("/export")
//    public void export(HttpServletResponse response){
//        //通过多线程一个线程生成一个月的Excel
//        //一共12个Excel达成压缩包
//
//        CountDownLatch countDownLatch = new CountDownLatch(12);
//        for (int i=1;i<=12;i++){
//            Thread thread = new Thread();
//            @Override
//                    public void run(){
//                long l = System.currentTimeMillis();
//                //查数据
//                long l1 = System.currentTimeMillis();
//                SXSSFWorkbook sheets = new SXSSFWorkbook(10000);
//                XSSFWorkbook sheets1 = new XSSFWorkbook(10000);
//                int i1 = sheets.addOlePackage();
//                CellStyle cellStyle = sheets.createCellStyle();
//                cellStyle.setAlignment(HorizontalAlignment.CENTER);
//                cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
//                CellStyle cellStyle1 = sheets.createCellStyle();
//                Font font = sheets.createFont();
//                font.setBold(true);
//                font.setFontHeightInPoints((short) 20);
//                //设置标题和内容
//            }
//        }
//    }

}
